#include <SimpleAmqpClient/SimpleAmqpClient.h>
#include <iostream>
int main(){
    // 创建一个channel频道
    AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create();
    // 开启消费状态
    channel->BasicConsume("myqueue","myqueue");
    // 申请一片内存空间(Envelope 信封)，接收消息
    AmqpClient::Envelope::ptr_t envelope;
    // 执行真正的消费行为
    bool flag = channel->BasicConsumeMessage(envelope,3000);
    if(flag){
        std::cout << "message = " << envelope->Message()->Body() << "\n";
    }
    else{
        std::cout << "timeout\n";
    }
}